class Student implements Cloneable{
    public int age;
    public String name;
    public Score s;
    public Student(int age, String name) {
        this.age = age;
        this.name = name;
        s = new Score();
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student tmp = (Student) super.clone();
        tmp.s = (Score)this.s.clone();
        return tmp;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}

class Score implements Cloneable{
    double score = 9.9;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

public class Test_0204 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student stu1 = new Student(18,"zhangsan");
        Student stu2 = (Student) stu1.clone();
//        System.out.println(stu1);
//        System.out.println(stu2);
        stu1.s.score = 0.9;
        System.out.println(stu1.s.score);
        System.out.println(stu2.s.score);
    }
}
